//
//  MGNavigator.h
//  Express
//
//  Created by lhongl on 2025/9/28.
//  Copyright © 2025 QM. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN

@interface MGNavigator : NSObject

/// window
+ (UIWindow *)window;


/// 根ViewController
+ (UIViewController *)rootViewController;


/// 当前viewController
+ (UIViewController *)currentViewController;


/// 跳转 [push]
/// - Parameter viewController: view
+ (void)pushViewController:(UIViewController *)viewController;

/// 跳转 [present]
/// - Parameter viewController: view
+ (void)presentViewController:(UIViewController *)viewController;


/// 返回指定界面
/// - Parameter cls: 界面
+ (void)goBackToViewContrller:(Class)cls;


/// 返回指定界面
/// - Parameter cls: 界面
/// - Parameter completion: 成功回调
+ (void)goBackToViewContrller:(Class)cls completion:(void(^ __nullable)(void))completion;


/// 返回根目录
/// - Parameter animated: 动画
+ (void)gobackToRoot:(BOOL)animated;


/// 返回上一页
/// - Parameter animated: 动画
+ (void)goback:(BOOL)animated;

@end

NS_ASSUME_NONNULL_END
